impl Solution {
    pub fn valid_palindrome(s: String) -> bool {
        let bs=s.as_bytes();
        
        return Solution::f(bs,true);
    }
    fn f(bs:&[u8],flag:bool)->bool{
        let (mut l,mut r)=(0,bs.len()-1);
        while l<r{
            if bs[l]!=bs[r]{
                if flag{
                    return Solution::f(&(bs[l+1..r+1]),false)||Solution::f(&(bs[l..r]),false);
                }else {
                    return false;
                }
                
            }
            l+=1;
            r-=1;
        }
        return true;
    }
}